import QtQuick 2.0
import "../utils.js" as Utils;

ImgLbl {
	id: lbl
	img: "image://default/goldnum/"
	transformOrigin: Item.TopLeft

	SequentialAnimation {
		id: ani
		running: false
		ParallelAnimation {
			PropertyAnimation {
				target: lbl
				property: "y"
				duration: 200
				to: lbl.y - (num > 150 ? 300 : num * 2);
			}

			PropertyAnimation {
				target: lbl
				property: "scale"
				duration: 200
				from: 0
			}
		}
		PauseAnimation {
			duration: 400
		}
		PropertyAnimation {
			target: lbl
			property: "opacity"
			duration: 200
			to: 0
			onStopped: lbl.destroy();
		}
	}

	Component.onCompleted: {
		var w = width * scale;
		if (w > Utils.AppWin.width) {
			scale = Utils.AppWin.width / width;
			x = 0;
		} else if (w + x > Utils.AppWin.width) {
			x = Utils.AppWin.width - w;
		}
		ani.start();
	}
}

